<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>NPS管理后台登录</title>
    <link rel="shortcut icon" href="https://image.xcodei.com/image/f2329ef13136748fafdff3fc4890a64b.png" type="image/x-icon">
    <link href="{{.web_base_url}}/static/css/bootstrap.min.css" rel="stylesheet">
    <link href="{{.web_base_url}}/static/font-awesome/css/font-awesome.css" rel="stylesheet">
    <link href="{{.web_base_url}}/static/css/style.css" rel="stylesheet">

</head>

<body class="gray-bg">

<div class="loginColumns animated fadeInDown">
    <div class="row">


        <div class="col-md-offset-3 col-md-6">
            <h2 class="font-bold">NPS</h2>

            <p>
                便捷的代理服务器
            </p>

            <p>
                使用它可以穿透内部网tcp，udp，socks5，http，p2p等
            </p>

            <p>
                和更多？
            </p>

            <p>
                goto <a href="//github.com/cnlh/nps">开源地址</a>
            </p>
            <div class="ibox-content">
                <form class="m-t" onsubmit="return false">
                    <div class="form-group">
                        <input name="username" class="form-control" placeholder="请输入用户名" required="">
                    </div>
                    <div class="form-group">
                        <input name="password" type="password" class="form-control" placeholder="请输入用户密码" required="">
                    </div>
                    <button onclick="login()" class="btn btn-primary block full-width m-b">登录</button>
                {{if eq true .register_allow}}
                    <a class="btn btn-sm btn-white btn-block" href="{{.web_base_url}}/login/register">还没有账户？去注册</a>
                {{end}}
                </form>
            </div>
        </div>
    </div>
    <hr/>
</div>

</body>
<script src="{{.web_base_url}}/static/js/jquery-2.1.1.js"></script>
</html>


<script type="text/javascript">
    // Login Page Flipbox control
    function login() {
        $.ajax({
            type: "POST",
            url: "{{.web_base_url}}/login/verify",
            data: $("form").serializeArray(),
            success: function (res) {
                if (res.status) {
                    window.location.href = "{{.web_base_url}}/index/index"
                } else {
                    alert(res.msg)
                }
            }
        })
        return false
    }
</script>
</body>
</html>